package com.duing.controller;

import com.duing.service.BookShelfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BookShelfController {

    @Autowired
    private BookShelfService bookShelfService;

    @GetMapping("/book/isCollect")
    @ResponseBody
    public boolean collect(String userId, String bookId) {
        Boolean isCollect = bookShelfService.collect(userId, bookId);
        return isCollect;
    }

    @GetMapping("/book/toCollect")
    @ResponseBody
    public boolean toCollect(String userId, String bookId) {
        return bookShelfService.toCollect(userId, bookId);
    }

}
